#include "documentation.h"

Documentation::Documentation(const QString &title, QWidget *parent) : QDockWidget(title, parent)
{
    setFeatures(QDockWidget::NoDockWidgetFeatures | QDockWidget::DockWidgetClosable);

    contenuDock = new QWidget;
    setWidget(contenuDock);

    container = new QTextEdit;
    dockLayout = new QVBoxLayout;
    dockLayout->addWidget(container);
    dockLayout->setMargin(0);

    contenuDock->setLayout(dockLayout);
    container->setMinimumWidth(400); /* Largeur du dock & du TextEdit */
    container->setReadOnly(true);
    container->setLineWrapMode(QTextEdit::NoWrap);
    container->viewport()->setCursor(Qt::ArrowCursor);
}

Documentation::~Documentation()
{
    delete container; delete dockLayout; delete contenuDock;
}

void Documentation::setContent(QString content)
{
    container->setPlainText(content);
}

void Documentation::setCommand(QString command)
{
    this->command = command;
}

QString Documentation::getCommand()
{
    return command;
}
